import Cookies from 'js-cookie'
import store from '@/store/user';

const TokenKey = 'token'

export function getToken() {
  console.log(store?.state()?.token)
  const token = store?.state()?.token
  return Cookies.get(TokenKey) || token
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}